<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @keyframes x{
             0%{
                 transform: translate(0);
             }
             100%{
                 transform: translate(1000px,0px);
                 background-color: pink;
             }
        }
        div{
            width: 200px;
            height: 200px;border-radius: 50%;
            background-color: skyblue;
            animation-name: x;
            animation-duration: 5s;
            /* 何时开始 */
            animation-delay: 1s;
            /* 重复次数  infinite无限循环*/
            animation-iteration-count: infinite;
            /* 是否反方向播放 默认是normal 想反方向播放就写alternate*/
            animation-direction: alternate;
            /* 动画结束后状态默认是backwards 如果想停留结束状态就写forwards */
             animation-fill-mode: forwards;
        }
        div:hover{
            /* 鼠标经过div停止动画 离开继续动画 */
            animation-play-state: paused;
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>